//引入css
require('../css/commCss/normalize.css')
require('../css/commCss/reset.css')
require('../css/commCss/property.css')
require('../css/commCss/basic.less')
require('animate.css')
require('../css/advert.less')

/**
 * 0. 需求 获取元素
 */
const jumpBox = document.querySelector('#jumpBox')
const jumpTime = document.querySelector('#jumpTime');

/**
 * 1. 需求 页面开启开启倒计时 点击跳过 页面跳转
 */
 document.addEventListener('DOMContentLoaded', function () {
    function jump(){
        let timeTwo = 5
        const timeId = setInterval(function(){
             --timeTwo
             if(timeTwo == 3){
                 jumpBox.style.display = 'block'
             }
             else if(timeTwo == 0){
                 clearInterval(timeId)
             }
        },1000)
    }
 
    jump()
     
    function setCountDown(){
       let time = 7
       let timerId = setInterval(function(){
           --time
           if(time <= 0){
               //关闭计时器
               clearInterval(timerId)
               location.href = './register.html'
           }else{
              jumpTime.textContent = `${time}s`
           }
       },1000)
   }

   setCountDown()


}) 